import { Col, Row, Spin, Form, Input, DatePicker } from 'antd';
import pageStyles from '@/common/pageLayout.less';
const TodayDatePicker: any = DatePicker;
export const UpdateForm = () => {
  /**updata表单的ref*/
  const [updateForm] = Form.useForm();

  return (
    <Spin spinning={false}>
      <div className={pageStyles['fromView-styles']}>
        <Form form={updateForm}>
          <Row>
            <Col span={8}>
              <Form.Item
                label="采购项目名称"
                name="projectName"
                rules={[
                  {
                    required: true,
                    message: '请输入采购项目名称',
                  },
                ]}
              >
                <Input placeholder="请输入采购项目名称" />
              </Form.Item>
            </Col>
            {/* <Col span={12}>
              <Form.Item
                label="项目费用"
                name="projectPrice"
                rules={[
                  {
                    required: true,
                    message: '请输入项目费用',
                  },
                ]}
              >
                <Input placeholder="请输入项目费用" />
              </Form.Item>
            </Col> */}
            <Col span={8}>
              <Form.Item
                label="预算费用"
                name="planPrice"
                rules={[
                  {
                    required: true,
                    message: '请输入预算费用',
                  },
                ]}
              >
                <Input placeholder="请输入预算费用" addonAfter={'元'} />
              </Form.Item>
            </Col>
            <Col span={8}>
              <Form.Item
                label="预计采购时间"
                name="purchaseTime"
                rules={[
                  {
                    required: true,
                    message: '请选择预计采购时间',
                  },
                ]}
              >
                <TodayDatePicker format={'YYYY-MM-DD'} />
              </Form.Item>
            </Col>
            <Col span={24}>
              <Form.Item
                label="需求概况"
                name="purchaseInfo"
                rules={[
                  {
                    required: true,
                    message: '请选择需求概况',
                  },
                ]}
              >
                <Input.TextArea
                  placeholder="请输入需求概况"
                  showCount
                  maxLength={200}
                  autoSize={{
                    minRows: 3,
                    maxRows: 6,
                  }}
                />
              </Form.Item>
            </Col>
          </Row>
        </Form>
      </div>
    </Spin>
  );
};
